<template>
  <div>
    父组件
    <hr />
    <Home5Child :name="name" @getDataList="getDataList111" />
  </div>
</template>

<script>
import Home5Child from '@/views/Home5Child.vue'
// console.log(Home5Child);
export default {
  components: {
    Home5Child
  },
  data () {
    return {
      // name: 'zhouzhou'
      name: this.$store.state.message

      /*
      const EventBus= new Vue()
      接收
      EventBus.$on('函数名'，res=>{
        console.log(res)
      })
      传递
      EventBus.$emit('函数名','传递参数')

      this.$EventBus.$on('函数名'，res=>{
        console.log(res)
      })

      this.$EventBus.$emit('函数名','传递的参数')

      */
    }
  },
  computed: {
    name1 () {
      return this.name + '98'
    }
  },
  methods: {
    getDataList111 (data) {
      console.log(data, 'data')
    }
  }
}
</script>

<style></style>
